<template>
  <div class="app-container">
    <div class="app-body">
      <div class="app-sidebar">
        <Sidebar></Sidebar>
      </div>
      <div class="app-content">
        <router-view></router-view>
      </div>
    </div>
    <div class="app-header">
      <Header></Header>
    </div>

    <!-- dialog -->
    <AddPhoneDialog v-if="addPhoneDialog"></AddPhoneDialog>
    <PhoneDialog v-if="phoneDialog"></PhoneDialog>
  </div>
</template>

<script>
import Sidebar from "./Siderbar";
import Header from "./Header";
import Footer from "./Footer";
import AddPhoneDialog from "./dialog/AddPhoneDialog";
import PhoneDialog from "./dialog/PhoneDialog";
export default {
  components: {
    Sidebar,
    Header,
    Footer,
    AddPhoneDialog,
    PhoneDialog
  },
  created() {
    console.log("-------pages-----")
  },
  computed: {
    addPhoneDialog() {
      return this.$store.state.addPhoneDialog;
    },
    phoneDialog() {
      return this.$store.state.phoneDialog;
    }
  }
};
</script>

<style lang="scss">
$gray-light: #bcbcbc;
.app-container {
  overflow: hidden;
  width: 100%;
  height: 100%;
  background-color: white;
}
.app-header {
  position: absolute;
  top: 0;
  height: 60px;
  width: 100%;
  background-color: rgba(0, 123, 255, 0.7);
  box-sizing: border-box;
}
.app-body {
  position: absolute;
  height: calc(100% - 60px);
  width: 100%;
  top: 60px;
  box-sizing: border-box;
  background-color: white;
  overflow: hidden;
}
.app-sidebar {
  position: absolute;
  height: 100%;
  width: 280px;
  background-color: white;
  box-shadow: -1px 0px 10px 1px $gray-light;
  box-sizing: border-box;
  overflow: hidden;
  transition: width 0.3s ease-in;
}
.app-content {
  position: absolute;
  height: 100%;
  width: calc(100% - 280px);
  left: 280px;
  transition: left 0.3s ease-in;
  box-sizing: border-box;
}
</style>